this.BX=this.BX||{};this.BX.Landing=this.BX.Landing||{};this.BX.Landing.UI=this.BX.Landing.UI||{};(function(e,t,n,i){"use strict";var a;var r=function(e){babelHelpers.inherits(t,e);function t(e){var n;babelHelpers.classCallCheck(this,t);n=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,e));n.setEventNamespace("BX.Landing.UI.Field.ListSettingsField.ListItem");n.setValue(e);return n}babelHelpers.createClass(t,[{key:"getTextField",value:function e(){var t=this;return this.cache.remember("textField",(function(){return new n.TextField({selector:"label",textOnly:true,onChange:t.onTextChange.bind(t)})}))}},{key:"onTextChange",value:function e(){this.emit("onChange")}},{key:"createInput",value:function e(){var t=this;return this.cache.remember("layout",(function(){return i.Tag.render(a||(a=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="landing-ui-field-list-settings-item-container">\n\t\t\t\t\t',"\n\t\t\t\t\t","\n\t\t\t\t</div>\n\t\t\t"])),t.getTextField().getLayout(),t.getCheckboxField().getLayout())}))}},{key:"getCheckboxField",value:function e(){var t=this;return this.cache.remember("checkbox",(function(){return new BX.Landing.UI.Field.Checkbox({compact:true,items:[{name:"",value:t.options.value}],onChange:t.onCheckboxChange.bind(t)})}))}},{key:"onCheckboxChange",value:function e(){this.emit("onChange");this.adjustState()}},{key:"adjustState",value:function e(){var t=this.getCheckboxField();var n=this.getTextField();if(t.getValue().length>0){n.enable()}else{n.disable()}}},{key:"setValue",value:function e(t){this.getTextField().setValue(t.name);this.getCheckboxField().setValue([t.checked?t.value:""]);this.adjustState()}},{key:"getValue",value:function e(){return{label:this.getTextField().getValue(),value:this.options.value,checked:this.getCheckboxField().getValue().length>0}}}]);return t}(t.BaseField);var l;function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function u(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){babelHelpers.defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var o=function(e){babelHelpers.inherits(t,e);function t(e){var n;babelHelpers.classCallCheck(this,t);n=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(t).call(this,u(u({},e),{},{textOnly:true})));n.setEventNamespace("BX.Landing.UI.Field.ListSettingsField");n.onChange=n.onChange.bind(babelHelpers.assertThisInitialized(n));n.items=[];n.options.items.forEach((function(e){n.addItem(e)}));return n}babelHelpers.createClass(t,[{key:"createInput",value:function e(){return i.Tag.render(l||(l=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="landing-ui-field-list-settings"></div>\n\t\t'])))}},{key:"addItem",value:function e(t){var n=new r(t);n.subscribe("onChange",this.onChange);i.Dom.append(n.getLayout(),this.input);this.items.push(n)}},{key:"onChange",value:function e(){this.emit("onChange")}},{key:"getValue",value:function e(){return this.items.map((function(e){return e.getValue()})).filter((function(e){return e.checked}))}}]);return t}(t.BaseField);e.ListSettingsField=o})(this.BX.Landing.UI.Field=this.BX.Landing.UI.Field||{},BX.Landing.UI.Field,BX.Landing.UI.Field,BX);
//# sourceMappingURL=listsettingsfield.bundle.map.js